var maxImageCount = 10;
var maxVideoCount = 10;
var maxTextCount = 10;
var SKIN_PATH = "images/";

$(function() {
    $("input[name=productActualPrice],input[name=productCount]").blur(
        function(e) {
            var productdiv = $(this).closest(".productdiv");
            var productActualPrice = productdiv.find(
                "input[name=productActualPrice]").val();
            var productCount = productdiv.find("input[name=productCount]")
                .val();
            var cp = parseFloat(productActualPrice)
                * parseFloat(productCount);
            productdiv.find("input[name=productCount]").parent("p").find(
                "> span > i").text(cp);
        });

    $("input[name=productActualPrice2],input[name=productCount2]").blur(
        function(e) {
            var productdiv = $(this).closest(".productdiv");
            var productActualPrice = productdiv.find(
                "input[name=productActualPrice2]").val();
            var productCount = productdiv.find("input[name=productCount2]")
                .val();
            var cp = parseFloat(productActualPrice)
                * parseFloat(productCount);
            productdiv.find("input[name=productCount2]").parent("p").find(
                "> span > i").text(cp);
        });

    $("input[name=productActualPrice3],input[name=productCount3]").blur(
        function(e) {
            var productdiv = $(this).closest(".productdiv");
            var productActualPrice = productdiv.find(
                "input[name=productActualPrice3]").val();
            var productCount = productdiv.find("input[name=productCount3]")
                .val();
            var cp = parseFloat(productActualPrice)
                * parseFloat(productCount);
            productdiv.find("input[name=productCount3]").parent("p").find(
                "> span > i").text(cp);
        });

    $('.step-3').delegate(
        '.type-check',
        'change',
        function(event) {
            if ($(this).is(':checked')) {
                $(this).parents('.type-select').eq(0).find(
                    '.type-ipt-panel').show();
            } else {
                $(this).parents('.type-select').eq(0).find(
                    '.type-ipt-panel').hide();
            }
            return false;
        });

    $("#pre").click(function() {
        Call.httpLoad('task/step1.html');
    });

    $("#next").click(function() {
        $("#form1").submit();
    });

});

function getExpress(expressNo) {
    $("#expressNo").val(expressNo);
    $("#expressNo").change(function() {
        var dataPrice = $(this).find("option:selected").data("price");
        if (dataPrice) {
            $("#express_price").text(dataPrice);
        }
    }).change();
}

function sortmsgch(n) {
    if (n == 1) {
        $('#directcar-prompt').css("display", "none");
    } else if (n == 2) {
        $('#directcar-prompt').css("display", "block");
    }
}

function myblur(num) {
    if ($("#productActualPrice" + num).val() != ""
        && $("#productCount" + num).val() != "") {
        console.log($("#productCount" + num).val())
        console.log($("#productActualPrice" + num).val())
        $("#mdpmoney" + num).html(
            (parseFloat($("#productCount" + num).val()) * parseFloat($(
                "#productActualPrice" + num).val())).toFixed(2));
    } else {
        $("#mdpmoney" + num).html(" ");
    }
}

var updown = httpcom + 'images/updowntriangle.png';
(function() {
    initShowAllAddress = function() {
        var $addressPanel = $('.alladdress');
        var $address = $('.goodsaddress');
        var $upaddress = $('.upaddress');
        var $addresswrap = $('.address-wrap');

        $address.mouseenter(function() {
            $addressPanel.show();
            $(this).find('.up-down-trian').css('background',
                'url(' + updown + ') 0 -7px no-repeat');
        });
        $addresswrap.mouseleave(function() {
            $addressPanel.hide();
            $address.find('.up-down-trian').css('background',
                'url(' + updown + ') 0 0 no-repeat');
        });

        $addressPanel.delegate('a', 'click', function() {
            var text = $(this).text();
            $upaddress.attr('value', text);
            $address.find('span:first').text(text);
            $address.attr('title', text);
        });
    };
    initShowAllAddress();
})();

function settimerelease() {// 垫付多搜索关键词定时设置
    var re = /^\d+$/;
    var count = 0;
    var isaddgoodcom = $('#commonKey1').is(':checked');
    var isaddwordcom = $('#commonKey2').is(':checked');
    var isaddimgcom = $('#commonKey3').is(':checked');
    check2_stepthree();
    if (isaddgoodcom) {
        count += getSelectNum("1");
    }
    if (isaddwordcom) {
        count += getSelectNum("2");
    }
    if (isaddimgcom) {
        count += getSelectNum("3");
    }
    var taskinterval = $('#publishDate').is(':checked');
    if (!taskinterval) {
        $("#taskinterval_info").html("");
        $.prompt("只有任务发布设置复选框勾选后设置才会生效");
        return;
    }
    var startdate = $("#publishDateDate").val();
    var starthour = $("#publishDateStartTime").val();
    var endhour = $("#publishDateEndTime").val();
    starthour1=starthour.replace(":","");
    endhour1=endhour.replace(":","");
    // console.log(starthour);
    // console.log(endhour);
    if (startdate == "") {
        return;
    }
    if (starthour1 == "") {
        return;
    }
    if (endhour1 == "") {
        return;
    }
    // if (!re.test(starthour) || parseInt(starthour) < 0) {
    // 	$("#taskinterval_info").html("");
    // 	$.prompt("任务发布设置 - 放单开始时间，只能设置0-23的正整数");
    // 	$("#publishDateStartTime").focus();
    // 	return false;
    // }
    // if (!re.test(endhour) || parseInt(endhour) > 24) {
    // 	$("#taskinterval_info").html("");
    // 	$.prompt("任务发布设置 - 放单结束时间，只能设置0-24的正整数");
    // 	$("#publishDateEndTime").focus();
    // 	return false;
    // }
    if (parseInt(endhour1) - parseInt(starthour1) == 0) {
        $("#taskinterval_info").html("");
        $.prompt("任务发布设置 - 放单时间点不能设置相同值");
        return false;
    }
    if (parseInt(endhour1) - parseInt(starthour1) < 0) {
        $("#taskinterval_info").html("");
        $.prompt("任务发布设置 - 放单开始时间不能小于放单结束时间");
        return false;
    }
    var intestatistics = $("#publishDateProductNum").val();
    if (intestatistics != "" && !re.test(intestatistics)) {
        $("#publishDateProductNum").val("");
        $("#taskinterval_info").html("");
        $("#publishDateProductNum").focus();
        $.prompt("任务发布设置 - 定时发布数只能填写正整数");
        return;

    }


    if (!re.test(intestatistics)) {
        $("#publishDateProductNum").val("");
        return false;
    }
    if (count == 0) {
        $("#publishDateProductNum").val("");
        $("#taskinterval_info").html("");
        $("#tasknum_one").focus();
        $.prompt("选择任务类型和单数");
        return false;
    }
    if (parseInt(intestatistics) > count) {
        $("#tasknum_one").val("");
        $("#taskinterval_info").html("");
        $.prompt("任务发布设置-当天总共发布数不能大于任务总单数：" + count + "单");
        return false;
    }

    // var a=Date.parse(new Date(starthour))-Date.parse(new Date(endhour));
    // var interval=a%(24*3600*1000);
    // var interva2=interval%(3600*1000);
    // var minute=Math.floor(interva2/(60*100));



    var interval_time = (parseInt(endhour1) - parseInt(starthour1)) * 60
        / parseInt(intestatistics);
    var interval_num = 1;
    if (interval_time < 2) {
        //interval_time = 1;
        //interval_num = 2;
    }
    interval_time = interval_time.toFixed(1);
//	interval_time = parseInt(interval_time);
    var minute=((endhour.split(":")[0] * 60 - starthour.split(":")[0] * 60) + (endhour.split(":")[1]-starthour.split(":")[1]))/intestatistics;

    $("#times").val(interval_time);
    var msg = '<span class="striking">' + startdate + '号开始，每天' + starthour
        + '点到' + endhour + '点之间，</span><span style="color: #ed6f09;">每'
        + minute + '分钟放出' + interval_num + '单</span>';
    $("#taskinterval_info").html(msg);
}

$(document).on('click', '.del-attachgoods', function() {// 删除商品
    var e = $(this).parents('.attached');
    e.hide();
    e.find('input[type="text"]').val('');
});

$(document).on('click', '#addattgoods', function() {// 商品新增
    var bTemp = true;
    for ( var i = 1; i < 4; i++) {
        if ($('#product_attached_' + i).css('display') == 'none') {
            $('#product_attached_' + i).show();
            bTemp = false;
        break
        }
        
    }
    if (bTemp) {
        $.prompt('最多增加两个附加商品');
    }
});

$(document).on('click', '.com-type-ipt-arr .delsk', function() {// 普通好评删除增加的搜索关键词
    var e = $(this).parents('.type-ipt-wrap');
    e.hide();
    e.find('input[type="text"]').val('');
    e.find('input[type="checkbox"]').attr('checked', false);
});

$(document).on('click', '.kw-type-ipt-arr .delsk', function() {
    var e = $(this).parents('.type-ipt-wrap');
    e.hide();
    e.find('input[type="text"]').val('');
    e.find('input[type="checkbox"]').attr('checked', false);
    e.find('select').val('1');
    getComment('2');
});

$(document).on('click', '.pic-type-ipt-arr .delsk', function() {
    var e = $(this).parents('.type-ipt-wrap');
    e.hide();
    e.find('input[type="text"]').val('');
    e.find('input[type="checkbox"]').attr('checked', false);
    e.find('select').val('1');
    getComment('3');
});

$(document).on('click', '.vd-type-ipt-arr .delsk', function() {
    var e = $(this).parents('.type-ipt-wrap');
    e.hide();
    e.find('input[type="text"]').val('');
    e.find('input[type="checkbox"]').attr('checked', false);
    e.find('select').val('1');
    getComment('4');
});

var currSelectValue = '';
$(document).on('click', '.dianfu-select', function() {
    currSelectValue = $(this).val();
});

function getSelectNum(index) {
    var num = 0;
    for ( var i = 1; i <= maxImageCount; i++) {
        if ($('#haoping' + index + '_' + i).css('display') != 'none') {
            num += ~~$('#haoping' + index + '_' + i).find('.dianfu').val();
        }
    }
    return num;
}

$(document).on('change', '.kw-type-ipt-arr .dianfu', function() {
    if (getSelectNum('2') > maxTextCount) {
        $(this).val(currSelectValue);
        $.prompt('文字好评任务每次最多可发'+maxTextCount+'单，您已添加' + getSelectNum('2') + '单');
        return false;
    }
    getComment('2');
});


$(document).on('change', '.pic-type-ipt-arr .dianfu', function() {
    if (getSelectNum('3') > maxImageCount) {
        $(this).val(currSelectValue);
        $.prompt('图片好评任务每次最多可发'+maxImageCount+'单，您已添加' + getSelectNum('3') + '单');
        return false;
    }
    getComment('3');
});

$(document).on('change', '.vd-type-ipt-arr .dianfu', function() {
    if (getSelectNum('4') > maxVideoCount) {
        $(this).val(currSelectValue);
        $.prompt('视频好评任务每次最多可发'+maxVideoCount+'单，您已添加' + getSelectNum('4') + '单');
        return false;
    }
    getComment('4');
});

$(document).on('click', '#com-add-sk', function() {// 普通好评删除增加的搜索关键词
    var bTemp = true;
    for ( var i = 1; i < 11; i++) {
        if ($('#haoping1_' + i).css('display') == 'none') {
            $('#haoping1_' + i).show();
            bTemp = false;
            break;
        }
    }
    if (bTemp) {
        $.prompt('普通好评任务最多添加10个搜索关键词');
    }
});

$(document).on('click', '#kw-add-sk', function() {
    var bTemp = 0;
    var count = 0;
    for ( var i = 1; i <= maxTextCount; i++) {
        if ($('#haoping2_' + i).css('display') == 'none') {
            if (bTemp == 0)
                bTemp = i;
        } else {
            count += ~~$('#haoping2_' + i).find('.dianfu').val();
        }
    }
    if (count >= maxTextCount) {
        $.prompt('文字好评任务每次最多发'+maxTextCount+'单，您文字好评任务总单数已满'+maxTextCount+'单');
        return false;
    }
    if (bTemp == 0) {
        $.prompt('文字好评任务最多添加'+maxTextCount+'个搜索关键词');
        return false;
    }
    $('#haoping2_' + bTemp).show();
    getComment('2');
});

$(document).on('click', '#pic-add-sk', function() {
    var bTemp = 0;
    var count = 0;
    for ( var i = 1; i <= maxImageCount; i++) {
        if ($('#haoping3_' + i).css('display') == 'none') {
            if (bTemp == 0)
                bTemp = i;
        } else {
            count += ~~$('#haoping3_' + i).find('.dianfu').val();
        }
    }
    if (count >= maxImageCount) {
        $.prompt('图片好评任务每次最多发'+maxImageCount+'单，您图片好评任务总单数已满'+maxImageCount+'单');
        return false;
    }
    if (bTemp == 0) {
        $.prompt('图片好评任务最多添加'+maxImageCount+'个搜索关键词');
        return false;
    }
    $('#haoping3_' + bTemp).show();
    getComment('3');
});

$(document).on('click', '#vd-add-sk', function() {
    var bTemp = 0;
    var count = 0;
    for ( var i = 1; i <= maxVideoCount; i++) {
        if ($('#haoping4_' + i).css('display') == 'none') {
            if (bTemp == 0)
                bTemp = i;
        } else {
            count += ~~$('#haoping4_' + i).find('.dianfu').val();
        }
    }
    if (count >= maxVideoCount) {
        $.prompt('视频好评任务每次最多发'+maxVideoCount+'单，您视频好评任务总单数已满'+maxVideoCount+'单');
        return false;
    }
    if (bTemp == 0) {
        $.prompt('视频好评任务最多添加'+maxVideoCount+'个搜索关键词');
        return false;
    }
    $('#haoping4_' + bTemp).show();
    getComment('4');
});

function getComment(index) {
    var count = getSelectNum(index);
    // var showMaxCount = 5;
    // if(index == 3)
    // {
    //     showMaxCount = maxImageCount;
    // }
    showMaxCount = maxImageCount;
    for ( var i = 1; i <= showMaxCount; i++) {
        if (i > count) {
            $('#comment_' + index + '_' + i).hide();
        } else {
            $('#comment_' + index + '_' + i).show();
        }
    }
}

function initItemList1(index, itemId, productLike, shopLike, shopcart) {
    if (itemId != '' || index == 1) {
        $('#haoping1_' + index).show();

        var taskType = $('#taskType').val();
        if (taskType == '2') {
            if (productLike == '1') {
                $('#productLike_1_' + index).attr('checked', true);
            }
            if (shopLike == '1') {
                $('#shopLike_1_' + index).attr('checked', true);
            }
            if (shopcart == '1') {
                $('#shopcart_1_' + index).attr('checked', true);
            }
        }
    }
}

function initItemList2(index, itemId) {
    if (itemId != '' || index == 1) {
        $('#haoping2_' + index).show();
    }
}

function initItemList3(index, itemId) {
    if (itemId != '' || index == 1) {
        $('#haoping3_' + index).show();
    }
}

function initItemList4(index, itemId) {
    if (itemId != '' || index == 1) {
        $('#haoping4_' + index).show();
    }
}

$("input[name=publishDate]").on('click', function() {
    var publishDate = $('input:radio[name=publishDate]:checked').val();
    showTimer(publishDate);
});

/*function showTimer(publishDate){
    if(publishDate == '1') {
        $('#oldTimerDiv').removeClass('hide');
        $('#newTimerDiv').addClass('hide');
    } else {
        $('#newTimerDiv').removeClass('hide');
        $('#oldTimerDiv').addClass('hide');
    }
}*/

// 文字任务初始化
function textTaskInit() {
    var planHtml = '';
    for (var j = 1; j <= maxImageCount; j++) {
        if(j==1)
        {
            planHtml += '<div class="type-ipt-wrap black" id="haoping2_'+j+'"><p class="sk-num f-pr">';
        }
        else
        {
            planHtml += '<div class="type-ipt-wrap" style="display:none" id="haoping2_'+j+'"><p class="sk-num f-pr">';
        }

        planHtml += '<span class="must-input"></span>搜索关键词'+j+' <input class="ipt search-keyword" name="keyword_2_'+j+'" id="keyword_2_'+j+'" value="" type="text">'
        planHtml += '添加垫付<select class="dianfu dianfu-select" name="num_2_'+j+'" id="num_2_'+j+'">';
        for (var i = 1;i <= maxImageCount; i++)
        {
            planHtml += '<option value="'+ i +'">'+ i +'</option>';
        }
        if(j == 1)
        {
            planHtml += '</select> 单</p></div>';
        }
        else
        {
            planHtml += '</select> 单';
            planHtml += '<a class="delsk striking" href="javascript: void(0)">删 除</a></p></div>';
        }

        textAppend(j);
    }
    $('#text_add_key').append(planHtml);
}
function textAppend(_index) {
    var textIndex = _index;
    var planHtml = '';

    planHtml += '<div class="com-kw-ct-ipt-wrap" id="comment_2_'+textIndex+'" style="display:none">';
    planHtml += '<div><img src="' + SKIN_PATH + 'pic_type_up_1.png"><span class="ipt-tt">设置第'+ textIndex + '单的文字</span></div>';

    planHtml += '<div>';
    planHtml += '<textarea class="wz_keyword_ct" name="remark_2_'+textIndex+'" id="remark_2_'+textIndex+'" cols="95" rows="5" placeholder="可填写完整的评价内容，最多999字"></textarea></div></div>';

    $('#wrap-kwtype-opt').append(planHtml);
}

// 图片任务初始化
function imageTaskInit() {
    var planHtml = '';
    for (var j = 1; j <= maxImageCount; j++) {
        if(j==1)
        {
            planHtml += '<div class="type-ipt-wrap" id="haoping3_'+j+'"><p class="sk-num f-pr">';
        }
        else
        {
            planHtml += '<div class="type-ipt-wrap" style="display:none" id="haoping3_'+j+'"><p class="sk-num f-pr">';
        }

        planHtml += '<span class="must-input"></span>搜索关键词'+j+' <input class="ipt search-keyword" name="keyword_3_'+j+'" id="keyword_3_'+j+'" value="" type="text">'
        planHtml += '添加垫付<select class="dianfu dianfu-select" name="num_3_'+j+'" id="num_3_'+j+'">';
        for (var i = 1;i <= maxImageCount; i++)
        {
            planHtml += '<option value="'+ i +'">'+ i +'</option>';
        }
        if(j == 1)
        {
            planHtml += '</select> 单</p></div>';
        }
        else
        {
            planHtml += '</select> 单';
            planHtml += '<a class="delsk striking" href="javascript: void(0)">删 除</a></p></div>';
        }

        imageAppend(j);
    }
    $('#pic_add_key').append(planHtml);
}
function imageAppend(_index) {
    var imageIndex = _index;
    var planHtml = '';

    planHtml += '<div class="pic-type-panel" id="comment_3_'+imageIndex+'" style="display:none">';
    planHtml += '<div class="pic-type-pp f-pr"><img class="pic-up-tip" src="' + SKIN_PATH + 'pic_type_up_1.png">设置第'+ imageIndex + '单的图片</div>';
    planHtml += '<div class="pic-type-rule"><span class="must-input"></span>上传照片中商品的规格：<input class="ipt pic-rule" name="sku_3_'+imageIndex+'" id="sku_3_'+imageIndex+'" type="text" value="" placeholder="如颜色，尺码"> <span class="prompt">规格设置一定要与图片上商品规格保持一致</span></div>';
    planHtml += '<div class="pic-type-upic f-cb">';
    planHtml += '<div class="f-fl"><span class="must-input" style="*top: 0px;"></span><span class="sub-title"> 选择图片：</span></div>';
    planHtml += '<div class="f-fl f-pr">';
    planHtml += '<div class="f-cb img-wrap">';

    var imgidStr = "";
    for (var j = 1; j <= 5; j++) {
        var strName = "imgUrl" + j + "_3_" + imageIndex;
        var leftpi = 132 + (j-1)*160;
        imgidStr += strName + ",";
        planHtml += '<img class="f-fl tphp " id="preview_imgUrl'+ j + '_3_'+imageIndex+'" src="' + SKIN_PATH + 'upload_icon.png" width="143px" height="143px">';
        planHtml += '<input type="hidden" name="' + strName+'" id="'+strName+'" value="">';
        planHtml += '<div id="delete-31-'+j+'" style="position:absolute;left:'+leftpi+'px;display:block;">';
        planHtml += '<a href="#" class="imgdelete" img="'+strName+'"><img src="' + SKIN_PATH + 'error_tag.png"></a></div>';
    }

    imgidStr = imgidStr.substr(0, imgidStr.length - 1);
    planHtml += '</div><div class="f-cb wrap-upbtn"><div class="btn-upfile f-fl"><div class="new-contentarea">';
    planHtml += '<a href="#" class="upload-img upimgs" module="task" imgid="'+imgidStr+'"><label for="upload-file"></label></a>';
    planHtml += '</div></div><div class="hint f-fl">最多可添加5张图片，每组照片拍摄的角度，背景不能一样 </div></div>';
    planHtml += '</div></div>';
    planHtml += '<div class="pic-type-cw f-cb"><p class="f-fl">评价要求：</p><div class="f-fl">';
    planHtml += '<textarea class="textarea pic-cw" name="remark_3_'+imageIndex+'" id="remark_3_'+imageIndex+'" placeholder="商家可自定义填写评价的文字要求"></textarea></div></div></div>';

    $('#wrap-pictype-opt').append(planHtml);
}


// 视频任务初始化
function videoTaskInit() {
    var planHtml = '';
    for (var j = 1; j <= maxImageCount; j++) {
        if(j==1)
        {
            planHtml += '<div class="type-ipt-wrap" id="haoping4_'+j+'"><p class="sk-num f-pr">';
        }
        else
        {
            planHtml += '<div class="type-ipt-wrap" style="display:none" id="haoping4_'+j+'"><p class="sk-num f-pr">';
        }

        planHtml += '<span class="must-input"></span>搜索关键词'+j+' <input class="ipt search-keyword" name="keyword_4_'+j+'" id="keyword_4_'+j+'" value="" type="text">'
        planHtml += '添加垫付<select class="dianfu dianfu-select" name="num_4_'+j+'" id="num_4_'+j+'">';
        for (var i = 1;i <= maxImageCount; i++)
        {
            planHtml += '<option value="'+ i +'">'+ i +'</option>';
        }
        if(j == 1)
        {
            planHtml += '</select> 单</p></div>';
        }
        else
        {
            planHtml += '</select> 单';
            planHtml += '<a class="delsk striking" href="javascript: void(0)">删 除</a></p></div>';
        }

        videoAppend(j);
    }
    $('#video_add_key').append(planHtml);

}
function videoAppend(_index) {
    var videoIndex = _index;
    var planHtml = '';

    planHtml += '<div class="pic-type-panel" id="comment_4_'+videoIndex+'" style="display:none">';
    planHtml += '<div class="pic-type-pp f-pr"><img class="pic-up-tip" src="' + SKIN_PATH + 'pic_type_up_1.png">设置第'+ videoIndex + '单的视频</div>';
    planHtml += '<div class="pic-type-rule"><span class="must-input"></span>上传视频中商品的规格：<input class="ipt pic-rule" name="sku_4_'+videoIndex+'" id="sku_4_'+videoIndex+'" type="text" value="" placeholder="如颜色，尺码"> <span class="prompt">规格设置一定要与视频上商品规格保持一致</span></div>';
    planHtml += '<div class="pic-type-upic f-cb">';
    planHtml += '<div class="f-fl"><span class="must-input" style="*top: 0px;"></span><span class="sub-title"> 选择图片：</span></div>';
    planHtml += '<div class="f-fl f-pr">';
    planHtml += '<div class="f-cb img-wrap">';

    var imgidStr = "";
    for (var j = 1; j <= 5; j++) {
        var strName = "imgUrl" + j + "_4_" + videoIndex;
        var leftpi = 132 + (j-1)*160;
        imgidStr += strName + ",";
        planHtml += '<img class="f-fl tphp " id="preview_imgUrl'+ j + '_4_'+videoIndex+'" src="' + SKIN_PATH + 'upload_icon.png" width="143px" height="143px">';
        planHtml += '<input type="hidden" name="' + strName+'" id="'+strName+'" value="">';
        planHtml += '<div id="delete-41-'+j+'" style="position:absolute;left:'+leftpi+'px;display:block;">';
        planHtml += '<a href="#" class="imgdelete" img="'+strName+'"><img src="' + SKIN_PATH + 'error_tag.png"></a></div>';
    }

    imgidStr = imgidStr.substr(0, imgidStr.length - 1);
    planHtml += '</div><div class="f-cb wrap-upbtn"><div class="btn-upfile f-fl"><div class="new-contentarea">';
    planHtml += '<a href="#" class="upload-img upimgs" module="task" imgid="'+imgidStr+'"><label for="upload-file"></label></a>';
    planHtml += '</div></div><div class="hint f-fl">最多可添加5张图片，每组照片拍摄的角度，背景不能一样 </div></div>';
    planHtml += '</div></div>';

    //视频上传
    planHtml += '<div class="vd-type-upic f-cb">';
    planHtml += '<div class="f-fl"><span class="must-input" style="*top: 0px;"></span><span class="sub-title"> 选择视频：</span></div>';
    planHtml += '<div class="f-fl f-pr"><div class="f-cb vd-wrap"><span id="span_videoUrl1_4_'+videoIndex+'"></span>';
    planHtml += '<input type="hidden" name="videoUrl1_4_'+videoIndex+'" id="videoUrl1_4_'+videoIndex+'" value=""></div><div class="f-cb wrap-upbtn"><div class="btn-upfile f-fl">';
    planHtml += '<div class="new-contentarea"><a href="#" class="upload-img upvideo" imgid="videoUrl1_4_'+videoIndex+'"><label for="upload-file"></label></a></div></div></div></div></div>';

    planHtml += '<div class="pic-type-cw f-cb"><p class="f-fl">评价要求：</p><div class="f-fl">';
    planHtml += '<textarea class="textarea pic-cw" name="remark_4_'+videoIndex+'" id="remark_4_'+videoIndex+'" placeholder="商家可自定义填写评价的文字要求"></textarea></div></div></div>';

    $('#wrap-videotype-opt').append(planHtml);
}